﻿<?php

session_start();
$lifeTime = 20*60; 
setcookie(session_name(), session_id(), time() + $lifeTime, "/"); 
include_once 'conn/mysql.php';
if(isset($_GET['oper'])){
	$oper=$_GET['oper'];
}else {
	$oper='';
}
if($oper=='login'){
	$user=$_POST['user'];
	$pwd=md5($_POST['pwd']);
if($user!=''){
	$res=sql('s','user',"*","where user='".$user."' and type=1");
	$info=firstrow($res);
	if ($info['pwd']==$pwd) {
		$_SESSION["user"]=$user;
echo "<script>window.location.href='/user/main.php'</script>";
	}else{
		echo "<script>alert('密码或者用户名不正确'); history.back();</script>";
	}
}else{
echo "<script>alert('密码或者用户名不正确'); history.back();</script>";
}
}elseif($oper=='user_detail') {
	$user=$_SESSION["user"];
	$data = array(
			"qq" => $_POST['qq'],
			"tel" => $_POST['mobile'],
			"zhifubao" => $_POST['zhifubao'],
			"xingming" => $_POST['xingming'],
			"email" => $_POST['email'],
			"ptlx" => $_POST['ptlx'],
			"haoyoushu" => $_POST['haoyoushu']
			);

	if($res=sql('u','user',$data,"where user='".$user."'")){
		$res=sql('u','user',$data,"where user='".$user."'");
		echo "<script>alert('信息修改成功'); history.back();</script>";
	}
}elseif($oper=='chgpw') {
	$user=$_SESSION["user"];
	if ($_POST['pwd']!==$_POST['repwd']) {
		echo "<script>alert('两次输入密码不同'); history.back();</script>";
	}else{
		
		$res=sql('s','user',"*","where user='".$user."'");
		$info=firstrow($res);
		if (md5($_POST['oldpwd'])!==gv($info,"pwd")) {
			echo "<script>alert('原始密码输入有误'); history.back();</script>";
		}else{
			$data=array("pwd"=>md5($_POST['pwd']));
			$res=sql('u','user',$data,"where user='".$user."'");
			echo "<script>alert('修改密码成功'); history.back();</script>";
		}
	}
	
}elseif($oper=='loginout'){
	session_destroy();
	echo "<script>window.location.href='/index.php'</script>";
}elseif($oper=='buy') {
	$dz=$_POST['province']."-".$_POST['city']."-".$_POST['area'];
	if($_GET['chan']!=''){
		$chan=$_GET['chan'];
		}else{
			$chan='0';
			}
	if($_POST['prurl']!=''){
		$prurl="window.location.href='".$_POST['prurl']."'";
	}else{
		$prurl='history.back()';
		}
	$res=sql("s", "channel", "*", "where id=".$chan);
	$info=firstrow($res);
	if ($chan!='0') {
		$data=array("click"=>gv($info,'click')+1);
		sql("u", "channel", $data, "where id=".$chan);
	}
	$data=array(
				"shr"=>$_POST['name'],
				"tel"=>$_POST['tel'],
					"dz"=>$dz,
					"xdz"=>$_POST['xdz'],
					"tjr"=>$_POST['tjr'],
					"sp_id"=>$_POST['sp_id'],
					"spm"=>$_POST['spm'],
					"suk"=>$_POST['suk'],
					"shangjia"=>$_POST['shangjia'],
					"channel"=>gv($info,"name"),
					"jg"=>$_POST['jg'],
					"time"=>date("m.d H:i"),
					"fc"=>$_POST['fc']
				);
		/*require_once 'wforder/public/wfnet.php';
		$mail->Subject = "客户『".$_POST['name']."』提交了新订单，请注意查收！";
		$mail->Body = "
		<div style='width:50%;margin: 0 auto;padding:30px;border:2px dotted #bd0a01;background:#FFC;'>
			<p align='center' style='height:40px;line-height:40px;font-size:28px;font-weight:bold;color:#bd0a01;border-bottom:2px dotted #bd0a01;'>".$_POST['name']."订单详情</p>
			<P>【下单时间】：".date("m.d H:i")."</P>
			<P>【订购产品】：".$_POST['spm']."</P>
			<P>【产品型号】：".$_POST['suk']."</P>
			<P>【数量总价】：".$_POST['jg']."</P>
			<P>【收货姓名】：".$_POST['name']."</P>
			<P>【所在地区】：".$dz."</P>
			<P>【详细地址】：".$_POST['xdz']."</P>
			<P>【手机号码】：<a href='http://www.baidu.com/s?wd=".$_POST['tel']."'>".$_POST['tel']."</a></P>
		</div>";*/
		$res=sql("i","list",$data,"");
		echo "<script>alert('订单提交成功！'); ".$prurl.";</script>";
}elseif($oper=='reg') {
	$res=sql("s","user","*","where user='".$_POST['user']."' or tel='".$_POST['tel']."' ");
	if ($res) {
		echo "<script>alert('用户名或电话已被使用，请重新注册');history.back();</script>";
	}else{
	$res=sql("s","user","*","where user='".$_POST['superior']."'");
	$info=firstrow($res);
	$data=array(
			'qq'=>$_POST['qq'],
			'tel'=>$_POST['tel'],
			'user'=>$_POST['user'],
			'email'=>$_POST['email'],
			'superior'=>$_POST['superior'],
			'pwd'=>md5($_POST['pwd']),
			'sup_qq'=>gv($info,"qq"),
			'time'=>date('Y-m-d H:i:s')
);
		$res=sql("i","user",$data,"");
		$data=array("next_num"=>gv($info,"next_num")+1);
		$res=sql("u","user",$data,"where user='".$_POST['superior']."'");
		echo "<script>alert('注册成功，请登录！'); window.location.href='/index.php';</script>";
}

}elseif($oper=='jiechu') {
		$res=sql("s","user","*","where user='".$_GET['user']."'");
		$info=firstrow($res);
		$data=array("next_num"=>gv($info,"next_num")-1);
		$res=sql("u","user",$data,"where user='".$_GET['user']."'");
		$res=sql("d","user","","where id='".$_GET['next_id']."'");
		echo "<script>alert('解除成功'); window.location.href='/user/invite_list.php';</script>";

}elseif($oper=='addchannel') {
		$data=array(
				"name"=>$_POST['name'],
				"shuoming"=>$_POST['shuoming'],
				"user"=>$_GET['user'],
				"num"=>$_POST['num'],
				"leixing"=>$_POST['leixing']
				);
		$res=sql("i","channel",$data,"");
		
		echo "<script>alert('添加成功'); window.location.href='/user/Channellist.php';</script>";

}elseif($oper=='editaddchannel') {
		$data=array(
				"name"=>$_POST['name'],
				"shuoming"=>$_POST['shuoming'],
				"user"=>$_GET['user']
				);
		$res=sql("i","channel",$data,"");
		
		echo "<script>alert('修改成功'); window.location.href='/user/addChannel.php';</script>";

}elseif($oper=='channeldel') {
		$id=$_GET['id'];
		$res=sql("d","channel","","where id=".$id);
		
		echo "<script>alert('删除成功'); window.location.href='/user/channellist.php';</script>";

}







/*elseif($oper=='foot') {
	$user=$_SESSION["unc"];
	$cprt=$_POST['cprt'];
	$contact=$_POST['contact'];
	$other=$_POST['other'];
	$postcode=$_POST['postcode'];
	$footstate=$_POST['footstate'];
	
	$data = array(
			"copyright" => "$cprt",
			"contact" => "$contact",
			"other" => "$other",
		   "postcode" => "$postcode",
		    "footstate" => "$footstate"
			);

	if($res=sql('u','face',$data,"where user='".$user."'")){
		$res=sql('u','face',$data,"where user='".$user."'");
		echo "<script>alert('信息修改成功'); history.back();</script>";
	}
	}elseif($oper=='face') {
	$user=$_SESSION["unc"];
	$pcmould=$_POST['pcmould'];
	$mmould=$_POST['mmould'];
	$title=$_POST['title'];
	$keyword=$_POST['keyword'];
	$describe=$_POST['describe'];
	$tel=$_POST['tel'];
	$adress=$_POST['adress'];
	$cprt=$_POST['cprt'];
	$data = array(
			"pcmould" => "$pcmould",
			"mmould" => "$mmould",
			"tel" => "$tel",
			"keyword" => "$keyword",
			"title" => "$title",
			"miaoshu" => "$describe",
			"adress" => "$adress",
			"cprt" => "$cprt"
			);
	if($res=sql('u','face',$data,"where user='".$user."'")){
		$res=sql('u','face',$data,"where user='".$user."'");
		echo "<script>alert('信息修改成功'); history.back();</script>";
	}
	}elseif($oper=='colum') {
		$user=$_SESSION["unc"];
		$res=sql('s', 'colum', 'id', "where user='".$user."'");
		foreach ($res as $info){
			$id=$info["id"];
			$user=$_SESSION["unc"];
			$order=$_POST["no_order_$id"];
			$name=$_POST["name_$id"];
			$module=$_POST["module_$id"];
			$isshow=$_POST["nav_$id"];
			$home_order=$_POST["index_num_$id"];
			$right=$_POST["access_$id"];
			$data=array(
			"wed_order"=>"$order",
			"name"=>"$name",
			"module"=>"$module",
			"wed_isshow"=>"$isshow",
			"home_order"=>"$home_order",
			"wed_right"=>"$right"
			);
			$res1=sql('u', 'colum',$data, "where id=".$id);
			
		}
?>
<!--内容begain  -->

<!-- 内容end -->
<?php 
		
		echo "<script>alert('信息修改成功'); history.back(); </script>";
	}elseif($oper=='sys_other') {
	$user=$_SESSION["unc"];
	$tel=$_POST['tel'];
	$qq=$_POST['qq'];
$title=$_POST['title'];
	$qq1=$_POST['qq1'];
	$qq2=$_POST['qq2'];
	$adress=$_POST['adress'];
	$coordinate=$_POST['lonlat'];
	$data = array(
			"tel" => "$tel",
 			"title" => "$title",
			"qq" => "$qq",
			"qq1" => "$qq1",
			"qq2" => "$qq2",
			"adress"=>"$adress",
			"coordinate" => "$coordinate"
			);
	if($res=sql('u','face',$data,"where user='".$user."'")){
		$res=sql('u','face',$data,"where user='".$user."'");
		echo "<script>alert('信息修改成功'); history.back();</script>";
	}
	}elseif($oper=='column_editor') {
	$user=$_SESSION["unc"];
	$id=$_GET['id'];
	$order=$_POST["no_order"];
	$name=$_POST["name"];
	$isshow=$_POST["nav"];
	$home_order=$_POST["index_num"];
	$right=$_POST["access"];
	$module=$_POST["module"];
	$keywords=$_POST["keywords"];
	$description=$_POST["description"];
	$data=array(
			"wed_order"=>"$order",
			"name"=>"$name",
			"wed_isshow"=>"$isshow",
			"home_order"=>"$home_order",
			"wed_right"=>"$right",
			"module"=>"$module",
			"keywords"=>"$keywords",
			"description"=>"$description"
	);
	$res1=sql('u', 'colum',$data, "where id=".$id);
	echo "<script>alert('信息修改成功'); history.back(); </script>";
	}elseif($oper=='column_del') {
	$user=$_SESSION["unc"];
	$id=$_GET['id'];
	
	$res1=sql('d', 'colum',"", "where id=".$id);
	echo "<script>alert('信息修改成功'); history.back(); </script>";
	}elseif($oper=='mould') {
	$user=$_SESSION["unc"];
	$pc=$_POST["pc"];
	$phone=$_POST["phone"];
	$data=array(
			"pcmould"=>"$pc",
			"mmould"=>"$phone",
	);
	$res1=sql('u', 'face',$data, "where user='".$user."'");
	echo "<script>alert('信息修改成功'); history.back(); </script>";
	}elseif($oper=='article') {
	$user=$_SESSION["unc"];
	$class=$_GET['class'];
	$title=$_POST["title"];
	$imgurl=$_POST["imgurl"];
	$keyword=$_POST["keyword"];
	$description=$_POST["description"];
	$content=$_POST["content"];
	$content=str_replace('src="/editor/', 'src="http://web.lovevi.cn/editor/', $content);
	
	$time=date("Y-m-d H-i-s");
	$data=array(
			"user"=>$user,
			"class"=>$class,
			"title"=>$title,
			"imgurl"=>$imgurl,
			"keyword"=>$keyword,
			"description"=>$description,
			"content"=>$content,
			"time"=>$time
	);
	$num=sql('frow', 'article',"*", "where user='".$user."' and class=".$class);
	if ($num!=1) {
		$res1=sql('i', 'article',$data, "");
	}else{
		$res1=sql('u', 'article',$data, "where class=".$class);
	}
	echo "<script>alert('信息修改成功'); history.back(); </script>";
	}elseif($oper=='article_tab') {
	$user=$_SESSION["unc"];
	$class=$_GET['class'];
	$order=$_POST["order"];
	$top=$_POST["top"];
	$recommend=$_POST["recommend"];
	$title=$_POST["title"];
	$imgurl=$_POST["imgurl"];
	$keyword=$_POST["keyword"];
	$description=$_POST["description"];
	$content=$_POST["content"];
$content=str_replace('src="/editor/', 'src="http://web.lovevi.cn/editor/', $content);
	
	$time=date("Y-m-d H-i-s");
	$data=array(
			"user"=>$user,
			"class"=>$class,
			"title"=>$title,
			"recommend"=>$recommend,
			"order_int"=>$order,
			"top"=>$top,
			"imgurl"=>$imgurl,
			"keyword"=>$keyword,
			"description"=>$description,
			"content"=>$content,
			"time"=>$time
	);
	if (isset($_GET['id'])) {
		$res1=sql('u', 'article_tab',$data, "where id=".$_GET['id']);
	}else{
		$res1=sql('i', 'article_tab',$data, "");
	}
	echo "<script>alert('信息修改成功'); history.back(); </script>";
	}elseif($oper=='article_tab_del') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		$class=$_GET['class'];
		$res1=sql('d', 'article_tab',"", "where id=".$_GET['id']);
		echo "<script>alert('删除成功');window.location.href='content/article_tab_edit.php?class=".$class."';</script>";
	}elseif($oper=='video') {
	$user=$_SESSION["unc"];
	$class=$_GET['class'];
	$order=$_POST["order"];
	$top=$_POST["top"];
	$recommend=$_POST["recommend"];
	$title=$_POST["title"];
	$imgurl=$_POST["imgurl"];
	$keyword=$_POST["keyword"];
	$description=$_POST["description"];
	$videourl=$_POST["videourl"];
	$time=date("Y-m-d H-i-s");
	$data=array(
			"user"=>$user,
			"class"=>$class,
			"title"=>$title,
			"recommend"=>$recommend,
			"order_int"=>$order,
			"top"=>$top,
			"imgurl"=>$imgurl,
			"keyword"=>$keyword,
			"description"=>$description,
			"videourl"=>$videourl,
			"time"=>$time
	);
	if (isset($_GET['id'])) {
		$res1=sql('u', 'video',$data, "where id=".$_GET['id']);
	}else{
		$res1=sql('i', 'video',$data, "");
	}
	echo "<script>alert('信息修改成功'); history.back(); </script>";
	}elseif($oper=='video_del') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		$class=$_GET['class'];
		$res1=sql('d', 'video',"", "where id=".$_GET['id']);
		echo "<script>alert('删除成功');window.location.href='content/video_edit.php?class=".$class."';</script>";
	}elseif($oper=='img') {
	$user=$_SESSION["unc"];
	$class=$_GET['class'];
	$order=$_POST["order"];
	$top=$_POST["top"];
	$recommend=$_POST["recommend"];
	$title=$_POST["title"];
	$imgurl=$_POST["imgurl"];
	$keyword=$_POST["keyword"];
	$description=$_POST["description"];
	$time=date("Y-m-d H-i-s");
	$data=array(
			"user"=>$user,
			"class"=>$class,
			"title"=>$title,
			"recommend"=>$recommend,
			"order_int"=>$order,
			"top"=>$top,
			"imgurl"=>$imgurl,
			"keyword"=>$keyword,
			"description"=>$description,
			"time"=>$time
	);
	if (isset($_GET['id'])) {
		$res1=sql('u', 'photo',$data, "where id=".$_GET['id']);
		echo "<script>alert('信息保存成功');window.location.href='content/img.php?class=".$class."&id=".$_GET['id']."'; </script>";
	}else{
		$id=$res1=sql('addid', 'photo',$data, "");
		echo "<script>alert('信息保存成功，请上传图片');window.location.href='content/img.php?class=".$class."&id=".$id."'; </script>";
	}

	}elseif($oper=='img_del') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		$class=$_GET['class'];
		$res1=sql('d', 'photo',"", "where id=".$_GET['id']);
		echo "<script>alert('删除成功');window.location.href='content/img_edit.php?class=".$class."';</script>";
	}elseif($oper=='lottery') {
	$user=$_SESSION["unc"];
	$class=$_GET['class'];
	$mould=$_POST['mould'];
	$probability1=$_POST["probability1"];
	$probability2=$_POST["probability2"];
	$probability3=$_POST["probability3"];
	$probability4=$_POST["probability4"];
	$probability5=$_POST["probability5"];
	$probability6=$_POST["probability6"];
	$probability7=$_POST["probability7"];
	$probability8=$_POST["probability8"];
	$content1=$_POST["content1"];
	$content2=$_POST["content2"];
	$content3=$_POST["content3"];
	$content4=$_POST["content4"];
	$content5=$_POST["content5"];
	$content6=$_POST["content6"];
	$content7=$_POST["content7"];
	$content8=$_POST["content8"];
	$time=date("Y-m-d H-i-s");
	$data=array(
			"probability1"=>$probability1,
			"probability2"=>$probability2,
			"probability3"=>$probability3,
			"probability4"=>$probability4,
			"probability5"=>$probability5,
			"probability6"=>$probability6,
			"probability7"=>$probability7,
			"probability8"=>$probability8,
			"content1"=>$content1,
			"content2"=>$content2,
			"content3"=>$content3,
			"content4"=>$content4,
			"content5"=>$content5,
			"content6"=>$content6,
			"content7"=>$content7,
			"content8"=>$content8,
			"mould"=>$mould,
			"class"=>$class,
			"time"=>$time
	);
	$res1=sql('s', 'lottery',"*", "where class=".$class);
	$level=arrayLevel($res1);
	if ($level==1) {
		$res1=sql('u', 'lottery',$data, "where class=".$class);
		echo "<script>alert('信息保存成功');window.location.href='content/lottery.php?class=".$class."'; </script>";
	}else{
		$res1=sql('i', 'lottery',$data, "");
		echo "<script>alert('信息保存成功');window.location.href='content/lottery.php?class=".$class."'; </script>";
	}

	}elseif($oper=='friendly') {
	$user=$_SESSION["unc"];
	$class=$_GET['class'];
	$order=$_POST["order"];
	$title=$_POST["title"];
	$imgurl=$_POST["imgurl"];
	$description=$_POST["description"];
	$url=$_POST["url"];
	$time=date("Y-m-d H-i-s");
	$data=array(
			"user"=>$user,
			"class"=>$class,
			"title"=>$title,
			"order_int"=>$order,
			"imgurl"=>$imgurl,
			"description"=>$description,
			"url"=>$url,
			"time"=>$time
	);
	if (isset($_GET['id'])) {
		$res1=sql('u', 'friendly',$data, "where id=".$_GET['id']);
	}else{
		$res1=sql('i', 'friendly',$data, "");
	}
	echo "<script>alert('信息修改成功'); history.back(); </script>";
	}elseif($oper=='friendly_del') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		$class=$_GET['class'];
		$res1=sql('d', 'friendly',"", "where id=".$_GET['id']);
		echo "<script>alert('删除成功');window.location.href='content/friendly_edit.php?class=".$class."';</script>";
	}elseif($oper=='feedback_del') {
		$user=$_SESSION["unc"];
		
		$id=$_GET['id'];
		sql("d", "leave_msg", "", "where id=".$id);
		echo "<script>alert('删除成功');window.location.href='feedback/feedback.php?user=".$user."';</script>";
	}elseif($oper=='leave_inc') {
		$user=$_SESSION["unc"];
		$class=$_GET['class'];
		if(isset($_POST['leave_show'])){
			$leave_show=$_POST['leave_show'];
		}else{
			$leave_show="0";
		}
		$data=array(
				"leave_show"=>$leave_show,
				"leave_time"=>$_POST['leave_time'],
				"leave_filter"=>$_POST['leave_filter']
				);
		sql("u", "face", $data, "where user='".$user."'");
		echo "<script>alert('修改成功');window.location.href='feedback/leave.php?class=".$class."';</script>";
	}elseif($oper=='leave_edit') {
		$user=$_SESSION["unc"];
		$class=$_GET['class'];
		$id=$_GET['id'];
		$data=array(
				"see"=>$_POST['button']
				);
		$res=sql("u", "leave_msg",$data,"where id=$id");
		
		echo "<script>alert('修改成功');window.location.href='feedback/leave.php?class=".$class."';</script>";
	}elseif($oper=='member_edit') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		
		$data=array(
				"pwd"=>$_POST['pwd'],
				"tel"=>$_POST['tel'],
				"email"=>$_POST['email'],
				"another"=>$_POST['another'],
				"act"=>$_POST['act']
				);
		$res=sql("u", "user",$data,"where id=$id");
		
		echo "<script>alert('修改成功');window.location.href='member/member.php';</script>";
	}elseif($oper=='head_img') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		$res=sql("s", "face", "*", "where user='".$user."'");
		if ($res['main_img']!=''){
		$info=explode('|', $res['main_img']);
		$info1=$info[$id];
		$info[$id]='|'.$info[$id];
		$rs=str_replace($info[$id],"",$res['main_img']);
		$data=array("main_img"=>$rs);
		$res=sql("u", "face",$data, "where user='".$user."'");
		unlink("../uploade/".$info1);
		}
		echo "<script>alert('修改成功');window.location.href='face/head.php';</script>";
	}elseif($oper=='mobile_img') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		$res=sql("s", "face", "*", "where user='".$user."'");
		if ($res['mobile_img']!=''){
		$info=explode('|', $res['mobile_img']);
		$info1=$info[$id];
		$info[$id]='|'.$info[$id];
		$rs=str_replace($info[$id],"",$res['mobile_img']);
		$data=array("mobile_img"=>$rs);
		$res=sql("u", "face",$data, "where user='".$user."'");
		unlink("../uploade/".$info1);
		}
		echo "<script>alert('修改成功');window.location.href='face/mobile.php';</script>";
	}elseif($oper=='img_img') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		$img_id=$_GET['img_id'];
		$res=sql("s", "photo", "*", "where id=".$img_id);
		$class=$res["class"];
		if ($res['img']!=''){
		$info=explode('|', $res['img']);
		$info1=$info[$id];
		$info[$id]='|'.$info[$id];
		$rs=str_replace($info[$id],"",$res['img']);
		$data=array("img"=>$rs);
		$res=sql("u", "photo",$data, "where id=".$img_id);
		unlink("../uploade/".$info1);
		}
		echo "<script>alert('修改成功');window.location.href='content/img.php?id=".$img_id."&class=".$class."';</script>";
	}elseif($oper=='destroy') {
		session_destroy();
		echo "<script>window.location.href='/index.php';</script>";
	}elseif($oper=='price') {
	$user=$_SESSION["unc"];
	$class=$_GET['class'];
	$order=$_POST["order"];
	$top=$_POST["top"];
	$recommend=$_POST["recommend"];
	$title=$_POST["title"];
	$price=$_POST["price"];
	$imgurl=$_POST["imgurl"];
	$keyword=$_POST["keyword"];
	$description=$_POST["description"];
	$content=$_POST["content"];
$content=str_replace('src="/editor/', 'src="http://web.lovevi.cn/editor/', $content);
	
	$time=date("Y-m-d H-i-s");
	$data=array(
			"user"=>$user,
			"class"=>$class,
			"title"=>$title,
			"price"=>$price,
			"recommend"=>$recommend,
			"order_int"=>$order,
			"top"=>$top,
			"imgurl"=>$imgurl,
			"keyword"=>$keyword,
			"description"=>$description,
			"content"=>$content,
			"time"=>$time
	);
	if (isset($_GET['id'])) {
		$res1=sql('u', 'price',$data, "where id=".$_GET['id']);
	}else{
		$res1=sql('i', 'price',$data, "");
	}
	echo "<script>alert('信息修改成功'); history.back(); </script>";
	}elseif($oper=='price_del') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		$class=$_GET['class'];
		$res1=sql('d', 'price',"", "where id=".$_GET['id']);
		echo "<script>alert('删除成功');window.location.href='content/article_tab_edit.php?class=".$class."';</script>";
	}elseif($oper=='user_pwd') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		$rand=date("His")*rand(0, 100);
		$data=array("pwd"=>$rand);
		$res1=sql('u', 'user',$data, "where id=".$_GET['id']);
		echo "<script>alert('密码初始化成功，初始密码是：".$rand."'); window.location.href='user/user.php?user=".$user."';</script>";
	}elseif($oper=='user_del') {
		$user=$_SESSION["unc"];
		$id=$_GET['id'];
		$res=sql("s", "user", "*","where id=".$_GET['id']);
		$name=$res['user'];
		sql('d', 'message',"", "where user='".$name."'");
		sql('d', 'user',"", "where id=".$_GET['id']);
		echo "<script>alert('删除成功'); window.location.href='user/user.php?user=".$user."';</script>";
	}
	
	
	*/
	
	
	
	
	
